package com.csis.security.domain;

import static com.csis.system.common.IStaticData.COLUMN_ROLE_ROLEID;
import static com.csis.system.common.IStaticData.COLUMN_ROLE_ROLENAME;
import static com.csis.system.common.IStaticData.TABLE_ROLE;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import com.csis.system.domain.User;

@Entity
@Table(name = TABLE_ROLE)
public class Role {
	@Id
	@Column(name = COLUMN_ROLE_ROLEID)
	private java.lang.Integer id = null;
	@Column(name = COLUMN_ROLE_ROLENAME)
	private java.lang.String roleName = null;

	@ManyToMany(cascade = { CascadeType.MERGE }, mappedBy = "roles", fetch = FetchType.EAGER)
	private Set<User> users = new LinkedHashSet<User>();

	/**
	 * @return the users
	 */
	public Set<User> getUsers() {
		return users;
	}

	public java.lang.Integer getId() {
		return id;
	}

	public void setId(java.lang.Integer roleId) {
		this.id = roleId;
	}

	public java.lang.String getRoleName() {
		return roleName;
	}

	public void setRoleName(java.lang.String roleName) {
		this.roleName = roleName;
	}

}
